#define _CRT_SECURE_NO_WARNINGS 1
int main()
{
	int a, b = 0;
	int c, d = 1;
	scanf("%d%d", a, b);
	for (c = a - 1; c > 1; c--)
	{
		if(a%c&&b%c==1)

	}
	return 0;
}